package com.ruoyi.bzjgl.controller;

import com.ruoyi.bzjgl.domain.Bzjtable;
import com.ruoyi.bzjgl.domain.SumBzjtable;
import com.ruoyi.bzjgl.service.IBzjtableService;
import com.ruoyi.bzjgl.service.IReportService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/report")
public class ReportController extends BaseController {
    @Autowired
    private IReportService reportService;
    @Autowired
    private IBzjtableService bzjtableService;


    @GetMapping("/reportList")
    public TableDataInfo reportList(Bzjtable bzjtable)
    {
        startPage();
        List<Bzjtable> list = reportService.selectReportList(bzjtable);
        return getDataTable(list);
    }



    @GetMapping("/sumList")
    public TableDataInfo sumList(SumBzjtable sumBzjtable)
    {
        startPage();
        List<Bzjtable> list = reportService.sumList(sumBzjtable);
        return getDataTable(list);
    }

    //收款查询
    @GetMapping("/skReport")
    public TableDataInfo skList(Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        List<Bzjtable> list = reportService.skList(bzjtable);
        return getDataTable(list);
    }

    //没收查询
    @GetMapping("/msReport")
    public TableDataInfo msList(Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        List<Bzjtable> list = reportService.msList(bzjtable);
        return getDataTable(list);
    }

    //退还查询
    @GetMapping("/thReport")
    public TableDataInfo thList(Bzjtable bzjtable){
        List<String> depNames = bzjtableService.getDepList();
        bzjtable.setDepNames(depNames);
        startPage();
        List<Bzjtable> list = reportService.thList(bzjtable);
        return getDataTable(list);
    }
}
